//
//  QNDividingRulerView.h
//  QNDividingRuler
//
//  Created by rsh on 2019/12/7.
//  Copyright © 2019年 rsh. All rights reserved.
//

#import "QNHeader.h"
#import "QNDividingRulerCell.h"


@interface QNDividingRulerView : UIView


/** 刻度尺是否可滚动；默认YES */
@property (nonatomic,assign) BOOL                   isScrollEnable;
/** 刻度尺两侧是否需要渐变阴影；默认YES */
@property (nonatomic,assign) BOOL                   isShowBothEndsOfGradient;
/** 刻度尺中间是否需要显示当前值；默认YES */
@property (nonatomic,assign) BOOL                   isShowCurrentValue;
/** 刻度尺上侧是否显示刻度内容；默认YES */
@property (nonatomic,assign) BOOL                   isShowScaleText;
/** 刻度尺上侧是否显示归零球；默认 NO */
@property (nonatomic,assign) BOOL                   isShowInPoint;
/** 刻度尺中间是否展示浮标；默认 YES */
@property (nonatomic,assign) BOOL                   isShowIndicator;
/** 刻度尺是否需要自定义，即刻度尺每个刻度非递增；默认 NO */
@property (nonatomic,assign) BOOL                   isCustomScalesValue;
/** 刻度尺是否需要在刻度处自动吸附；默认 YES */
@property (nonatomic,assign) BOOL                   isShouldAdsorption;
/** 刻度尺浮标处刻度内容是否需要高亮；默认 YES */
@property (nonatomic,assign) BOOL                   isShouldHighlightText;
/** 刻度尺底部横线是否显示；默认 NO */
@property (nonatomic,assign) BOOL                   isShowBottomLine;
/**
 * 三角图标、面包图片与中间当前值的显示是互斥的，可根据数组的个数来判定，默认显示中间当前值，默认空数组;
 * 数组格式例如：imageArray = @[@{@"scaleIndex":@"0",@"image":@"mb_20"},@{@"scaleIndex":@"5",@"image":@"http://www.baidu.com/urlString"}];
 * scaleIndex 为刻度上显示图片的序列号，从0开始；image 为本地图片名称或者网络地址.
 **/
@property (nonatomic, strong) NSArray               *imageArray;
/**    传入进来的模型形式     */
@property(nonatomic,assign) DividingRulerStyle       rulerStyle;



/**    刻度     */
@property (nonatomic,assign) CGFloat                lineSpace; ///横向两刻度之间的间距，默认18
@property (nonatomic,assign) CGFloat                lineWidth; ///刻度的宽度，默认1
@property (nonatomic,assign) CGFloat                largeLineHeight; ///长刻度的高度，默认30
@property (nonatomic,strong) UIColor              * largeLineColor; ///长刻度的颜色
@property (nonatomic,strong) UIColor              * smallLineColor; ///短刻度的颜色
@property (nonatomic,assign) CGFloat                smallLineHeight; ///短刻度的宽度，默认30
@property (nonatomic,assign) NSInteger              scalesCountBetweenLargeLine; ///刻度之间的步径
@property (nonatomic,assign) NSInteger              scalesCountBetweenScaleText; ///刻度文案之间的刻度格数
@property (nonatomic,assign) QNRulerAlignmentType currentRulerAlignment;



/**   刻度显示文本  */
@property (nonatomic,strong) UIColor              * scaleTextColor;
/// 刻度文本字体大小
@property (nonatomic,assign) CGFloat                scaleTextFloat;
///要显示刻度尺上的文案必须要调用
@property (nonatomic,copy)   NSString             * (^scaleTextFormatBlock)(CGFloat currentValue,NSInteger scaleIndex);
/// 刻度文本离刻度线底部的距离，默认15
@property (nonatomic,assign) CGFloat                scaleTextLargeLineSpace;



/**    值     */
@property (nonatomic,assign) CGFloat                maxValue;
@property (nonatomic,assign) CGFloat                minValue;
//两刻度间隔值，默认为1
@property (nonatomic,assign) CGFloat                unitValue;
@property (nonatomic,assign) CGFloat                defaultValue;



/**    中间浮标     */
@property (nonatomic,strong) UIColor              * indicatorViewColor;
@property (nonatomic,assign) CGFloat                indicatorHeight;
@property (nonatomic,assign) CGFloat                indicatorWidth;



/**    归零点原球     */
@property (nonatomic,strong) UIColor              * inPointColor;
@property (nonatomic,assign) CGFloat                inPointWH;
@property (nonatomic,assign) CGFloat                inPointLargeLineSpace;
@property (nonatomic,assign) CGFloat                inPointCurrentValue;      //需要显示归零球的值
@property (nonatomic,assign) CGFloat                inPointCurrentScale;     //自定义刻度时，需要显示归零球的刻度

/**    两侧渐变色     */
@property (nonatomic,assign) CGFloat                gradientLayerWidth;

/**    底线     */
@property (nonatomic,strong) UIColor              * bottomLineColor;
@property (nonatomic,assign) CGFloat                bottomLineHeight;

/**    回调当前值     */
@property (nonatomic,copy)   NSString *             (^dividingRulerDidEndScrollingBlock)(CGFloat value);
@property (nonatomic,copy)   NSString *             (^dividingRulerDidScrollBlock) (CGFloat value,CGPoint rulerContentOffset);



/**    自定义刻度相关     */
@property (nonatomic,assign) NSInteger              customScalesCount;
@property (nonatomic,assign) CGFloat                defaultScale;
@property (nonatomic,copy)   NSString             * (^customScaleTextFormatBlock)(CGFloat currentCalibrationIndex);
@property (nonatomic,copy)   NSString             * (^dividingRulerCustomScaleDidEndScrollingBlock)(CGFloat index);
@property (nonatomic,copy)   NSString             * (^dividingRulerCustomScaleDidScrollBlock)(CGFloat index);



/**
 更新刻度尺数据显示，数据更新后，必须调用此方法来更新数据，否则不会生效
 */
-(void)updateRuler;

- (void)updateScrollerViewContentOffset:(CGPoint)pointOffset;



@end



